package com.example.administrator.im.config;

import android.content.Context;
import android.util.Log;

import com.example.administrator.im.MyApplication;

/**
 * create:2018/9/13 23:04
 * author: 姚鸿杰
 **/
public class PhoneParam {

    private static PhoneParam mPhoneParam;

    private PhoneParam(Context context) {
        s_screen_width = context.getResources().getDisplayMetrics().widthPixels;
        s_screen_height = context.getResources().getDisplayMetrics().heightPixels;

        /**
         * 获取状态栏高度
         */
        //获取status_bar_height资源的ID
        int resourceId = MyApplication.getmContext().getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            //根据资源ID获取响应的尺寸值
            status_height = MyApplication.getmContext().getResources().getDimensionPixelSize(resourceId);
        }
        activity_height = s_screen_height - status_height;
    }

    public static PhoneParam getInstance(Context context) {
        if (null == mPhoneParam) {
            mPhoneParam = new PhoneParam(context);
        }
        return mPhoneParam;
    }

    /**
     * 屏幕宽高
     */
    private int s_screen_width;
    private int s_screen_height;

    private int status_height;

    private int activity_height;

    public int getS_screen_width() {
        return s_screen_width;
    }

    public int getS_screen_height() {
        return s_screen_height;
    }

    public int getActivity_height() {
        return activity_height;
    }

    public int getStatus_height() {
        return status_height;
    }
}
